﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Besture.Bll;
using Besture.Common;
using Besture.Utils;

namespace Besture.UI.Admin.Content
{
    public partial class WebSet : BasePage
    {

        #region 页面加载事件

        /// <summary>
        /// 页面加载
        /// </summary>
        protected override void InitialLoad()
        {
            InitData();
        }

        /// <summary>
        /// 回发
        /// </summary>
        protected override void PostBackLoad()
        {
           
        }

        /// <summary>
        /// 数据加载
        /// </summary>
        protected void InitData()
        {
            ShortContentDac shortContentDac = new ShortContentDac();
            txtBlogging.Text = shortContentDac.GetContent("Blogging").EntryValue;
            txtConsulting.Text = shortContentDac.GetContent("Consulting").EntryValue;
            txtConsultingTow.Text = shortContentDac.GetContent("ConsultingTow").EntryValue;
            MicroChannel.ImageUrl = shortContentDac.GetContent("MicroChannel").EntryValue;
            txtSina.Text = shortContentDac.GetContent("Sina").EntryValue;
            txtQQ.Text = shortContentDac.GetContent("QQ").EntryValue;
            txtEmail.Text = shortContentDac.GetContent("Email").EntryValue;
            txtAddress.Text = shortContentDac.GetContent("Address").EntryValue;
            txtICP.Text = shortContentDac.GetContent("ICP").EntryValue;
        }
        #endregion

        #region 保存

        protected void btnSubmit_Click(object sender, EventArgs eventArgs)
        {
            ShortContentDac shortContentDac = new ShortContentDac();
            shortContentDac.SetContent("Blogging", txtBlogging.Text);
            shortContentDac.SetContent("MicroChannel", MicroChannel.ImageUrl);
            shortContentDac.SetContent("Sina", txtSina.Text);
            shortContentDac.SetContent("QQ", txtQQ.Text);
            shortContentDac.SetContent("Consulting", txtConsulting.Text);
            shortContentDac.SetContent("ConsultingTow", txtConsultingTow.Text);
            shortContentDac.SetContent("Email", txtEmail.Text);
            shortContentDac.SetContent("Address", txtAddress.Text);
            shortContentDac.SetContent("ICP", txtICP.Text);
            Fun.Alert("保存成功", "WebEdit.aspx");
        }
        #endregion
    }
}